<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>prometheus-client-c: prom/include/prom_collector_registry.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">prometheus-client-c
   &#160;<span id="projectnumber">0.1.1</span>
   </div>
   <div id="projectbrief">Prometheus client for the C programming language</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_2c63f04010e7ff462eba5e344f58cd21.html">prom</a></li><li class="navelem"><a class="el" href="dir_83821d63a26a6eb889c4977bd95ca990.html">include</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">prom_collector_registry.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>The collector registry registers collectors for metric exposition.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="prom__collector_8h_source.html">prom_collector.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="prom__metric_8h_source.html">prom_metric.h</a>&quot;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for prom_collector_registry.h:</div>
<div class="dyncontent">
<div class="center"><img src="prom__collector__registry_8h__incl.png" border="0" usemap="#prom_2include_2prom__collector__registry_8h" alt=""/></div>
<map name="prom_2include_2prom__collector__registry_8h" id="prom_2include_2prom__collector__registry_8h">
<area shape="rect" id="node2" href="prom__collector_8h.html" title="A Prometheus collector returns a collection of metrics. " alt="" coords="24,95,155,121"/>
<area shape="rect" id="node4" href="prom__metric_8h.html" title="Functions for retrieving metric samples from metrics given an ordered set of labels. " alt="" coords="133,169,251,196"/>
<area shape="rect" id="node3" href="prom__map_8h_source.html" title="prom_map.h" alt="" coords="5,169,109,196"/>
<area shape="rect" id="node5" href="prom__metric__sample_8h.html" title="Functions for interfacting with metric samples directly. " alt="" coords="11,251,183,278"/>
<area shape="rect" id="node6" href="prom__metric__sample__histogram_8h.html" title="Functions for interacting with histogram metric samples directly. " alt="" coords="208,244,368,285"/>
</map>
</div>
</div><div class="textblock"><div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="prom__collector__registry_8h__dep__incl.png" border="0" usemap="#prom_2include_2prom__collector__registry_8hdep" alt=""/></div>
<map name="prom_2include_2prom__collector__registry_8hdep" id="prom_2include_2prom__collector__registry_8hdep">
<area shape="rect" id="node2" href="prom_8h.html" title="Include prom.h to include the entire public API. " alt="" coords="5,95,163,121"/>
<area shape="rect" id="node3" href="promhttp_8h.html" title="Provides a HTTP endpoint for metric exposition References: " alt="" coords="187,95,397,121"/>
</map>
</div>
</div>
<p><a href="prom__collector__registry_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a20f07748401fbbde9efc8a718f9bc202"><td class="memItemLeft" align="right" valign="top"><a id="a20f07748401fbbde9efc8a718f9bc202"></a>
typedef struct prom_collector_registry&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a></td></tr>
<tr class="memdesc:a20f07748401fbbde9efc8a718f9bc202"><td class="mdescLeft">&#160;</td><td class="mdescRight">A prom_registry_t is responsible for registering metrics and briding them to the string exposition format. <br /></td></tr>
<tr class="separator:a20f07748401fbbde9efc8a718f9bc202"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:aaf1421bd744f0dbbdaba7e64cec11f54"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector__registry_8h.html#aaf1421bd744f0dbbdaba7e64cec11f54">prom_collector_registry_default_init</a> (void)</td></tr>
<tr class="memdesc:aaf1421bd744f0dbbdaba7e64cec11f54"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the default collector registry and enables metric collection on the executing process.  <a href="#aaf1421bd744f0dbbdaba7e64cec11f54">More...</a><br /></td></tr>
<tr class="separator:aaf1421bd744f0dbbdaba7e64cec11f54"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab5d622258998978c528253f07e2903b8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector__registry_8h.html#ab5d622258998978c528253f07e2903b8">prom_collector_registry_new</a> (const char *name)</td></tr>
<tr class="memdesc:ab5d622258998978c528253f07e2903b8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a prom_collector_registry_t*.  <a href="#ab5d622258998978c528253f07e2903b8">More...</a><br /></td></tr>
<tr class="separator:ab5d622258998978c528253f07e2903b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad3854e6e40b6f741fde53dc65f0ecd87"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector__registry_8h.html#ad3854e6e40b6f741fde53dc65f0ecd87">prom_collector_registry_destroy</a> (<a class="el" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *self)</td></tr>
<tr class="memdesc:ad3854e6e40b6f741fde53dc65f0ecd87"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroy a collector registry.  <a href="#ad3854e6e40b6f741fde53dc65f0ecd87">More...</a><br /></td></tr>
<tr class="separator:ad3854e6e40b6f741fde53dc65f0ecd87"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0d59bf988de4ee29e076910fa7135071"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector__registry_8h.html#a0d59bf988de4ee29e076910fa7135071">prom_collector_registry_enable_process_metrics</a> (<a class="el" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *self)</td></tr>
<tr class="memdesc:a0d59bf988de4ee29e076910fa7135071"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable process metrics on the given collector registry.  <a href="#a0d59bf988de4ee29e076910fa7135071">More...</a><br /></td></tr>
<tr class="separator:a0d59bf988de4ee29e076910fa7135071"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a113683f4e15ad9240a37ed2139ddaea6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector__registry_8h.html#a113683f4e15ad9240a37ed2139ddaea6">prom_collector_registry_must_register_metric</a> (<a class="el" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a> *metric)</td></tr>
<tr class="memdesc:a113683f4e15ad9240a37ed2139ddaea6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers a metric with the default collector on PROM_DEFAULT_COLLECTOR_REGISTRY.  <a href="#a113683f4e15ad9240a37ed2139ddaea6">More...</a><br /></td></tr>
<tr class="separator:a113683f4e15ad9240a37ed2139ddaea6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa735fa0fbe03d6d9a0d11eb4792ec761"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector__registry_8h.html#aa735fa0fbe03d6d9a0d11eb4792ec761">prom_collector_registry_register_metric</a> (<a class="el" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a> *metric)</td></tr>
<tr class="memdesc:aa735fa0fbe03d6d9a0d11eb4792ec761"><td class="mdescLeft">&#160;</td><td class="mdescRight">Registers a metric with the default collector on PROM_DEFAULT_COLLECTOR_REGISTRY.  <a href="#aa735fa0fbe03d6d9a0d11eb4792ec761">More...</a><br /></td></tr>
<tr class="separator:aa735fa0fbe03d6d9a0d11eb4792ec761"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a42203da085c6c6f2bc3ba31501683882"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector__registry_8h.html#a42203da085c6c6f2bc3ba31501683882">prom_collector_registry_register_collector</a> (<a class="el" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *self, <a class="el" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a> *collector)</td></tr>
<tr class="memdesc:a42203da085c6c6f2bc3ba31501683882"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register a collector with the given registry.  <a href="#a42203da085c6c6f2bc3ba31501683882">More...</a><br /></td></tr>
<tr class="separator:a42203da085c6c6f2bc3ba31501683882"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0149a2702ae0b3ff39d57904d613c14f"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector__registry_8h.html#a0149a2702ae0b3ff39d57904d613c14f">prom_collector_registry_bridge</a> (<a class="el" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *self)</td></tr>
<tr class="memdesc:a0149a2702ae0b3ff39d57904d613c14f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a string in the default metric exposition format.  <a href="#a0149a2702ae0b3ff39d57904d613c14f">More...</a><br /></td></tr>
<tr class="separator:a0149a2702ae0b3ff39d57904d613c14f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acf002221c3239584723f9fb15c53e15e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector__registry_8h.html#acf002221c3239584723f9fb15c53e15e">prom_collector_registry_validate_metric_name</a> (<a class="el" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *self, const char *metric_name)</td></tr>
<tr class="memdesc:acf002221c3239584723f9fb15c53e15e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Validates that the given metric name complies with the specification:  <a href="#acf002221c3239584723f9fb15c53e15e">More...</a><br /></td></tr>
<tr class="separator:acf002221c3239584723f9fb15c53e15e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a6092b48e150390c1927da5fe8914981b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector__registry_8h.html#a6092b48e150390c1927da5fe8914981b">PROM_COLLECTOR_REGISTRY_DEFAULT</a></td></tr>
<tr class="memdesc:a6092b48e150390c1927da5fe8914981b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the default registry by calling prom_collector_registry_init within your program.  <a href="#a6092b48e150390c1927da5fe8914981b">More...</a><br /></td></tr>
<tr class="separator:a6092b48e150390c1927da5fe8914981b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>The collector registry registers collectors for metric exposition. </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="a0149a2702ae0b3ff39d57904d613c14f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0149a2702ae0b3ff39d57904d613c14f">&#9670;&nbsp;</a></span>prom_collector_registry_bridge()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char* prom_collector_registry_bridge </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns a string in the default metric exposition format. </p>
<p>The string MUST be freed to avoid unnecessary heap memory growth.</p>
<p>Reference: <a href="https://prometheus.io/docs/instrumenting/exposition_formats/">https://prometheus.io/docs/instrumenting/exposition_formats/</a></p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>The target prom_collector_registry_t* </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The string int he default metric exposition format. </dd></dl>

</div>
</div>
<a id="aaf1421bd744f0dbbdaba7e64cec11f54"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaf1421bd744f0dbbdaba7e64cec11f54">&#9670;&nbsp;</a></span>prom_collector_registry_default_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int prom_collector_registry_default_init </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initializes the default collector registry and enables metric collection on the executing process. </p>
<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure </dd></dl>

</div>
</div>
<a id="ad3854e6e40b6f741fde53dc65f0ecd87"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad3854e6e40b6f741fde53dc65f0ecd87">&#9670;&nbsp;</a></span>prom_collector_registry_destroy()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int prom_collector_registry_destroy </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Destroy a collector registry. </p>
<p>You MUST set self to NULL after destruction. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>The target prom_collector_registry_t* </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure </dd></dl>

</div>
</div>
<a id="a0d59bf988de4ee29e076910fa7135071"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0d59bf988de4ee29e076910fa7135071">&#9670;&nbsp;</a></span>prom_collector_registry_enable_process_metrics()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int prom_collector_registry_enable_process_metrics </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *&#160;</td>
          <td class="paramname"><em>self</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enable process metrics on the given collector registry. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>The target prom_collector_registry_t* </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure </dd></dl>

</div>
</div>
<a id="a113683f4e15ad9240a37ed2139ddaea6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a113683f4e15ad9240a37ed2139ddaea6">&#9670;&nbsp;</a></span>prom_collector_registry_must_register_metric()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a>* prom_collector_registry_must_register_metric </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a> *&#160;</td>
          <td class="paramname"><em>metric</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Registers a metric with the default collector on PROM_DEFAULT_COLLECTOR_REGISTRY. </p>
<p>The metric to be registered MUST NOT already be registered with the given . If so, the program will halt. It returns a prom_metric_t* to simplify metric creation and registration. Furthermore, PROM_DEFAULT_COLLECTOR_REGISTRY must be registered via <a class="el" href="prom__collector__registry_8h.html#aaf1421bd744f0dbbdaba7e64cec11f54" title="Initializes the default collector registry and enables metric collection on the executing process...">prom_collector_registry_default_init()</a> prior to calling this function. The metric will be added to the default registry's default collector.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">metric</td><td>The metric to register on PROM_DEFAULT_COLLECTOR_REGISTRY* </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The registered prom_metric_t* </dd></dl>

</div>
</div>
<a id="ab5d622258998978c528253f07e2903b8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab5d622258998978c528253f07e2903b8">&#9670;&nbsp;</a></span>prom_collector_registry_new()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a>* prom_collector_registry_new </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructs a prom_collector_registry_t*. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>The name of the collector registry. It MUST NOT be default. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The constructed prom_collector_registry_t* </dd></dl>

</div>
</div>
<a id="a42203da085c6c6f2bc3ba31501683882"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a42203da085c6c6f2bc3ba31501683882">&#9670;&nbsp;</a></span>prom_collector_registry_register_collector()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int prom_collector_registry_register_collector </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a> *&#160;</td>
          <td class="paramname"><em>collector</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Register a collector with the given registry. </p>
<p>Returns a non-zero integer value on failure. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>The target prom_collector_registry_t* </td></tr>
    <tr><td class="paramname">collector</td><td>The prom_collector_t* to register onto the prom_collector_registry_t* as self </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure </dd></dl>

</div>
</div>
<a id="aa735fa0fbe03d6d9a0d11eb4792ec761"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa735fa0fbe03d6d9a0d11eb4792ec761">&#9670;&nbsp;</a></span>prom_collector_registry_register_metric()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int prom_collector_registry_register_metric </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a> *&#160;</td>
          <td class="paramname"><em>metric</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Registers a metric with the default collector on PROM_DEFAULT_COLLECTOR_REGISTRY. </p>
<p>Returns an non-zero integer value on failure.</p>
<p>See prom_collector_registry_must_register_metric.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">metric</td><td>The metric to register on PROM_DEFAULT_COLLECTOR_REGISTRY* </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure </dd></dl>

</div>
</div>
<a id="acf002221c3239584723f9fb15c53e15e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acf002221c3239584723f9fb15c53e15e">&#9670;&nbsp;</a></span>prom_collector_registry_validate_metric_name()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int prom_collector_registry_validate_metric_name </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>metric_name</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Validates that the given metric name complies with the specification: </p>
<p>Reference: <a href="https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels">https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels</a></p>
<p>Returns a non-zero integer value on failure.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">self</td><td>The target prom_collector_registry_t* </td></tr>
    <tr><td class="paramname">metric_name</td><td>The metric name to validate </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure </dd></dl>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="a6092b48e150390c1927da5fe8914981b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6092b48e150390c1927da5fe8914981b">&#9670;&nbsp;</a></span>PROM_COLLECTOR_REGISTRY_DEFAULT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a>* PROM_COLLECTOR_REGISTRY_DEFAULT</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the default registry by calling prom_collector_registry_init within your program. </p>
<p>You MUST NOT modify this value. </p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
